#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	int n;
	cin >> n;
	for (int x = 100; x > 0; x--) {
		for (int k = 1; k <= 1000; k++) {
			if (52 * (21 * k + 7 * x) == n) {
				cout << x << endl << k;
				return 0;
			}
		}
	}
	return 0;
}
